package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallAttachment;
import com.appkubes.mall.core.po.MallAttachmentExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallAttachmentMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallAttachmentSqlProvider.class, method="countByExample")
    long countByExample(MallAttachmentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallAttachmentSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallAttachmentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_attachment",
        "where attachment_key = #{attachmentKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String attachmentKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_attachment (attachment_key, app_key, ",
        "`uid`, filename, attachment, ",
        "`type`, create_time, ",
        "update_time, module_upload_dir, ",
        "group_key, url, version)",
        "values (#{attachmentKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{uid,jdbcType=INTEGER}, #{filename,jdbcType=VARCHAR}, #{attachment,jdbcType=VARCHAR}, ",
        "#{type,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER}, ",
        "#{updateTime,jdbcType=INTEGER}, #{moduleUploadDir,jdbcType=VARCHAR}, ",
        "#{groupKey,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER})"
    })
    int insert(MallAttachment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallAttachmentSqlProvider.class, method="insertSelective")
    int insertSelective(MallAttachment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallAttachmentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="attachment_key", property="attachmentKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="uid", property="uid", jdbcType=JdbcType.INTEGER),
        @Result(column="filename", property="filename", jdbcType=JdbcType.VARCHAR),
        @Result(column="attachment", property="attachment", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="module_upload_dir", property="moduleUploadDir", jdbcType=JdbcType.VARCHAR),
        @Result(column="group_key", property="groupKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="url", property="url", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallAttachment> selectByExampleWithRowbounds(MallAttachmentExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallAttachmentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="attachment_key", property="attachmentKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="uid", property="uid", jdbcType=JdbcType.INTEGER),
        @Result(column="filename", property="filename", jdbcType=JdbcType.VARCHAR),
        @Result(column="attachment", property="attachment", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="module_upload_dir", property="moduleUploadDir", jdbcType=JdbcType.VARCHAR),
        @Result(column="group_key", property="groupKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="url", property="url", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallAttachment> selectByExample(MallAttachmentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "attachment_key, app_key, `uid`, filename, attachment, `type`, create_time, update_time, ",
        "module_upload_dir, group_key, url, version",
        "from mall_attachment",
        "where attachment_key = #{attachmentKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="attachment_key", property="attachmentKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="uid", property="uid", jdbcType=JdbcType.INTEGER),
        @Result(column="filename", property="filename", jdbcType=JdbcType.VARCHAR),
        @Result(column="attachment", property="attachment", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="module_upload_dir", property="moduleUploadDir", jdbcType=JdbcType.VARCHAR),
        @Result(column="group_key", property="groupKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="url", property="url", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallAttachment selectByPrimaryKey(String attachmentKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallAttachmentSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallAttachment record, @Param("example") MallAttachmentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallAttachmentSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallAttachment record, @Param("example") MallAttachmentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallAttachmentSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallAttachment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_attachment
     *
     * @mbg.generated
     */
    @Update({
        "update mall_attachment",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "`uid` = #{uid,jdbcType=INTEGER},",
          "filename = #{filename,jdbcType=VARCHAR},",
          "attachment = #{attachment,jdbcType=VARCHAR},",
          "`type` = #{type,jdbcType=TINYINT},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "module_upload_dir = #{moduleUploadDir,jdbcType=VARCHAR},",
          "group_key = #{groupKey,jdbcType=VARCHAR},",
          "url = #{url,jdbcType=VARCHAR},",
          "version = #{version,jdbcType=INTEGER}",
        "where attachment_key = #{attachmentKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallAttachment record);
}